
<template>
    <div class="register-page">
        <h1>登录排队机系统</h1>
        <!-- <form @submit.prevent="handleSubmit">
        <label for="username">用户名:</label>
        <input type="text" id="username" v-model="form.username" required>
        <label for="password">密码:</label>
        <input type="password" id="password" v-model="form.password" required>
        <button type="submit">注册</button>
        <el-input placeholder="请账号" v-model="input"  style="width: 150px; padding-top: 10px;"></el-input>
        <el-input placeholder="请输入密码" v-model="input" show-password  style="width: 150px; padding-top: 10px;"></el-input>
        <el-button type="primary" @click="setlimit1">登录</el-button>
      </form> -->
        <el-input placeholder="请账号" v-model="input1" style="width: 250px; padding-top: 10px;"></el-input>
        <br>
        <el-input placeholder="请输入密码" v-model="input2" show-password
            style="width: 250px; padding-top: 10px;"></el-input>
        <br>
        <el-button type="primary" @click="setlogin">登录</el-button>

    </div>
</template>
   
  <script>
export default {
    data() {
        return {
            input1: "",
            input2: "",
        };
    },
    computed: {
        globalVar() {
            return this.$store.state.globalVar;
        }
    },
    methods: {
        updateGlobalVar(newValue) {
            this.$store.commit('updateGlobalVar', newValue);
        },
        setlogin: function(){
            if(this.input1 == "1" && this.input2 == "1"){
                // this.updateGlobalVar(1)
                this.input1 = "";
                this.input2 = "";
                this.$router.push('/main'); 
                
            }
            else{
                alert("账号或用户名错误")
            }
        },
    }
  };
  </script>